import { defineStore, acceptHMRUpdate } from 'pinia';

interface MainState {
  componentList: any;
}

export const useMainStore = defineStore({
  id: 'main',
  state: (): MainState => ({
    componentList: [],
  }),
  actions: {
    addComponentList(data: any) {
      this.componentList.push(data);
      console.log(this.componentList);
    },
  },
});

if (import.meta.hot) {
  import.meta.hot.accept(acceptHMRUpdate(useMainStore, import.meta.hot));
}
